﻿<UserControl x:Class="SMS.Views.SalesModule.SaleReceipt"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
             mc:Ignorable="d"
             d:DesignHeight="300"
             d:DesignWidth="400">
    <Border BorderBrush="Black"
            CornerRadius="5"
            BorderThickness="1">
        <Grid x:Name="LayoutRoot"
              Margin="5"
              Background="White">
            <Grid.RowDefinitions>
                <RowDefinition Height="30" />
                <RowDefinition Height="2" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="2" />
                <RowDefinition Height="*" />
                <RowDefinition Height="2" />
                <RowDefinition Height="30" />
                <RowDefinition Height="2" />
                <RowDefinition Height="30" />
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Text="Logo Goes here" />
            </StackPanel>
            <Rectangle Stroke="Black"
                       Height="1"
                       Grid.Row="1"
                       VerticalAlignment="Center"
                       StrokeThickness=".5" />
            <Grid Grid.Row="2">
                <Grid.RowDefinitions>
                    <RowDefinition />
                    <RowDefinition />
                    <RowDefinition />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="4" />
                    <ColumnDefinition />
                </Grid.ColumnDefinitions>
                <TextBlock Text="Slip:" />
                <TextBlock Text="Staff:"
                           Grid.Row="1" />
                <TextBlock Text="Date:"
                           Grid.Row="2" />
                <TextBlock Text="{Binding Path=Sale_ID, FallbackValue=0000001}"
                           Grid.Column="2" />
                <TextBlock Text="{Binding Path=SalesManDetail.SalesMan_Name, FallbackValue=Vinod}"
                           Grid.Row="1"
                           Grid.Column="2" />
                <TextBlock Text="{Binding Path=Selling_Date, FallbackValue=20-Jun-1988 04:40}"
                           Grid.Column="2"
                           Grid.Row="2" />
            </Grid>
            <Rectangle Stroke="Black"
                       Height="1"
                       Grid.Row="3"
                       StrokeThickness=".5" />
            <Grid Grid.Row="4">
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="2" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="2" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200" />
                        <ColumnDefinition Width="75" />
                        <ColumnDefinition Width="*" />
                    </Grid.ColumnDefinitions>
                    <TextBlock Text="Description" />
                    <TextBlock Text="Qty."
                               Grid.Column="1" />
                    <TextBlock Text="Amount"
                               Grid.Column="2" />
                </Grid>
                <Rectangle Stroke="Black"
                           Height="1"
                           Grid.Row="1"
                           StrokeThickness=".5" />
                <ListBox Grid.Row="2"
                         BorderBrush="{x:Null}"
                         IsHitTestVisible="False"
                         ItemsSource="{Binding Path=SalesDetailList}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid>
                                <Grid.ColumnDefinitions>
                                    <ColumnDefinition Width="200" />
                                    <ColumnDefinition Width="75" />
                                    <ColumnDefinition Width="*" />
                                </Grid.ColumnDefinitions>
                                <TextBlock Text="{Binding Path=ProductStockWise.Product.Product_Name, FallbackValue=No-Desc}" />
                                <TextBlock Text="{Binding Path=Quantity}"
                                           Grid.Column="1" />
                                <TextBlock Text="{Binding Path=BilledAmount, StringFormat=N2}"
                                           TextAlignment="Right"
                                           Grid.Column="2" />
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </Grid>
            <Rectangle Stroke="Black"
                       Height="1"
                       Grid.Row="5"
                       StrokeThickness=".5" />
            <StackPanel HorizontalAlignment="Right"
                        Grid.Row="6"
                        Margin="0,0,5,0"
                        Orientation="Horizontal">
                <TextBlock Text="Total: "
                           VerticalAlignment="Center" />
                <TextBlock Text="{Binding Path=ActualSelliingPrice, StringFormat=N2, FallbackValue=0.00}"
                           VerticalAlignment="Center" />
            </StackPanel>
            <Rectangle Stroke="Black"
                       Height="1"
                       Grid.Row="7"
                       StrokeThickness=".5" />
            <Grid Grid.Row="8">
                <TextBlock TextAlignment="Center">Thanks for shopping with us. Visit Again.</TextBlock>
            </Grid>
        </Grid>
    </Border>
</UserControl>
